<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['系统基础管理','续费记录联调']" icon="fa fa-list"
			class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header><span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>续费记录联调</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn" style="width: calc(100% - 220px);">
								<sa-company-tree-car companyTreeId="companyTree" wrapId="content"
									[isShowCarSort]="false" [isShowCarNum]="true"
									(companySelected)="companySelected($event)"></sa-company-tree-car>
								<div class="top_module">
									<span class="module_text">时间类型</span>
									<select name="" id="" class="module_inp" [(ngModel)]="dateType"
										(change)="changeDateType()">
										<option value="1">缴费时间</option>
										<option value="2">开始时间</option>
										<option value="3">结束时间</option>
									</select>
								</div>
								<div class="top_module">
									<span class="module_text">类型</span>
									<select name="" id="" class="module_inp" [(ngModel)]="requestType">
										<option value="">全部</option>
										<option value="1">联调</option>
										<option value="2">正式</option>
									</select>
								</div>
								<!-- <div class="top_module">
									<span class="module_text">数据来源</span>
									<select name="" id="" class="module_inp" [(ngModel)]="dataSourceType">
										<option value="">全部</option>
										<option value="1">批量导入</option>
										<option value="2">随你运小程序</option>
										<option value="3">平台新增</option>
										<option value="4">API接口对接</option>
									</select>
								</div> -->
								<div class="selectDate top_module">
									<table-select-date [notInit]='false' [specifyId]='specifyId'
										(outerTime)="getSelectTableTime($event)" [specifyTime]='specifyTime'>
									</table-select-date>
								</div>
								<button type="button" class="btn btn-primary" (click)="tableSearch()">查询</button>
							</div>
							<div class="right top-search">
								<input type="text" [(ngModel)]="searchKey" (change)="tableSearch()" class="search-input"
									placeholder="车牌号、公司名称、设备ID">
								<span class="top-search-box">
									<button class="top-search-btn" type="button" (click)="tableSearch()"> <i
											class="fa fa-search"></i></button>
								</span>
							</div>
						</div>
						<div class="tabbable">
							<ul class="nav nav-tabs" id="myTab"
								style="padding-left: 12px; background-image: linear-gradient(#f1f5fd, #e9f0ff)">
								<li class="s-lis" [ngClass]="{ active: billType === 1 }">
									<a data-toggle="tab" href="#apply" (click)="tabChange(1)">服务费</a>
								</li>
								<li class="s-lis" [ngClass]="{ active: billType === 2 }">
									<a data-toggle="tab" href="#rise" (click)="tabChange(2)">对接费</a>
								</li>
							</ul>
						</div>
						<div class="table_scroll">
							<table
								class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>车牌号</th>
										<th>设备ID</th>
										<th>对接公司</th>
										<th>缴费时间
											<span class="sort-icon">
												<i class="fa fa-caret-left"
													[ngClass]="{active:sortTime == 1 && dateType == 1}"
													(click)="columnSort(1,1)"></i>
												<i class="fa fa-caret-right"
													[ngClass]="{active:sortTime == 2 && dateType == 1}"
													(click)="columnSort(2,1)"></i>
											</span>
										</th>
										<th>开始时间
											<span class="sort-icon">
												<i class="fa fa-caret-left"
													[ngClass]="{active:sortTime == 1 && dateType == 2}"
													(click)="columnSort(1,2)"></i>
												<i class="fa fa-caret-right"
													[ngClass]="{active:sortTime == 2 && dateType == 2}"
													(click)="columnSort(2,2)"></i>
											</span>
										</th>
										<th>结束时间
											<span class="sort-icon">
												<i class="fa fa-caret-left"
													[ngClass]="{active:sortTime == 1 && dateType == 3}"
													(click)="columnSort(1,3)"></i>
												<i class="fa fa-caret-right"
													[ngClass]="{active:sortTime == 2 && dateType == 3}"
													(click)="columnSort(2,3)"></i>
											</span>
										</th>
										<th>续费时长</th>
										<th>数据来源</th>
										<th>类型</th>
										<th>创建时间</th>
										<th>创建人</th>
										<!-- 这里也根据权限 -->
										<th *ngIf="isShowDelete">操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData"
										[ngClass]='{selected: activeSelected === row.id }'>
										<td>{{row.carNumber}}</td>
										<td>{{row.deviceId}}</td>
										<td>{{row.companyName}}</td>
										<td>{{row.createDate}}</td>
										<td>{{row.startTime}}</td>
										<td>{{row.endTime}}</td>
										<td>{{row.renewalCycle}}个月</td>
										<td>
											<span
												*ngIf="row.dataSource == 1 || row.dataSource == '' || row.dataSource == null ">批量导入</span>
											<span *ngIf="row.dataSource == 2">随你运小程序</span>
											<span *ngIf="row.dataSource == 3">平台新增</span>
											<span *ngIf="row.dataSource == 4">API接口对接</span>
										</td>
										<td>
											<span *ngIf="row.requestType == 1 || row.requestType == null ">联调</span>
											<span *ngIf="row.requestType == 2">正式</span>
										</td>
										<td>{{row.createTime}}</td>
										<td>{{row.createName}}</td>
										<!-- 这里也根据权限 -->
										<td *ngIf="isShowDelete">
											<button type="button" (click)="del_domCode(row)">删除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCounts" [rows]="pageSize" [currentPage]="curPage - 1"
								(onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i
									class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>
</div>

<style>
	.dockingListSelect {
		display: block;
		width: 100%;
		height: 32px;
		line-height: 32px;
		border-color: #ccc;
	}
</style>